package uy.edu.um.ltic.server.business;

import java.util.ArrayList;

import uy.edu.um.ltic.exception.DataBaseException;
import uy.edu.um.ltic.server.persistence.GeneralEntitiesDAOFactory;

public class GeneralEntitiesMgr implements GeneralEntitiesMgt {
	private static GeneralEntitiesMgr instance;

	private GeneralEntitiesMgr() {
	}

	public static GeneralEntitiesMgr getInstance() {
		if (instance == null) {
			instance = new GeneralEntitiesMgr();
		}
		return instance;
	}

	@Override
	public void addCountry(String country) throws DataBaseException {
		GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().addCountry(country);
			
	}

	@Override
	public void addPositionInCompany(String positionInCompany) throws DataBaseException {
		GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().addPositionInCompany(positionInCompany);
			
	}

	@Override
	public void addBranch(String branch) throws DataBaseException {
		GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().addBranch(branch);	
	}

	@Override
	public void addDepartment(String department) throws DataBaseException {
		GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().addDepartment(department);
			
	}

	@Override
	public void deleteCountry(String country) throws DataBaseException {
		GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().deleteCountry(country);
			
	}

	@Override
	public void deletePositionInCompany(String positionInCompany) throws DataBaseException {
		GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().deletePositionInCompany(positionInCompany);
		
	}

	@Override
	public void deleteBranch(String branch) throws DataBaseException {
		GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().deleteBranch(branch);
				
	}

	@Override
	public void deleteDepartment(String department) throws DataBaseException {
		GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().deleteDepartment(department);
			
	}

	@Override
	public ArrayList<String> getCountries() throws DataBaseException {
		ArrayList<String> oListCountry =	GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().getCountries();
		return oListCountry;
	}

	@Override
	public ArrayList<String> getPositionsInCompany() throws DataBaseException {
		ArrayList<String> oListPositionsInCompany =	GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().getPositionsInCompany();
		return oListPositionsInCompany;
	}

	@Override
	public ArrayList<String> getBranches() throws DataBaseException {
		ArrayList<String> oListBranches =	GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().getBranches();
		return oListBranches;
}

	@Override
	public ArrayList<String> getDepartments() throws DataBaseException {
		ArrayList<String> oListDepartments =	GeneralEntitiesDAOFactory.getInstance().getGeneralEntitiesDAOMgt().getDepartments();
		return oListDepartments;
	}

	
	
}
